import request from '@/utils/request'

const MENU_BASE_URL = '/system-service/admin/system/sysMenu'

export default{
    findNodes(){
        return request({
            url:`${MENU_BASE_URL}/findNodes`,
            method:'get'
        })
    },
    saveMenu(sysMenu){
        return request({
            url:`${MENU_BASE_URL}/save`,
            method:'post',
            data:sysMenu
        })
    },
    updateMenu(sysMenu){
        return request({
            url:`${MENU_BASE_URL}/update`,
            method:'post',
            data:sysMenu
        })
    },
    remoeveMenu(id){
        return request({
            url:`${MENU_BASE_URL}/delete/${id}`,
            method:'delete'
        })
    },
    toAssign(roleId){
        return request({
                url:`${MENU_BASE_URL}/toAssign/${roleId}`,
                method:'get'
            })
    },
    doAssign(roleMenuObj){
        return request({
            url:`${MENU_BASE_URL}/doAssign`,
            method:'post',
            data:roleMenuObj
        })
    }
}